*** Settings ***
Library    String
Library    DateTime

*** Variables ***
${DEFAULT_LENGTH}    8

*** Test Cases ***
choose a keyword
    ${today}=    Get Current UTC Time
    Log    ${today}
    ${future}=    Get Future Week Time    ${today}    7
    Log    ${future}
    ${year}   ${month}    ${day}    My Split Date    ${future}
    # 获取现在的日期
    ${today_cn}    Get Time    
    Log    ${today_cn}
    Input Date In Calendar    ${today_cn}

*** Keywords ***
My Split Date
    [Arguments]    ${str}    ${separator}=-
    ${date_parts}=    Split String    ${str}    ${separator}
    Log    ${date_parts}
    ${year}=    Set Variable    ${date_parts}[0]
    ${month}=    Set Variable    ${date_parts}[1]
    ${day}=    Set Variable    ${date_parts}[2]
    RETURN    ${year}    ${month}    ${day}

#   获取UTC时间
Get Current UTC Time
    ${utc_time}=    Get Current Date       UTC
    Log    ${utc_time}
    RETURN    ${utc_time}
Get Future Week Time
    [Arguments]    ${current_date}        ${add_days}
    ${future_date}=    Add Time To Date    ${current_date}      ${add_days}days
        ${future_date}
    
Input Date In Calendar
    [Arguments]    ${date_value}    ${date_separator}=-
    ${date_parts}=    Split String    ${date_value}    ${date_separator}
    ${date_length}=    Get Length    ${date_parts}
    ${date_parts_len}=    Get Length    ${date_parts}
    Should Be True    ${date_parts_len} > 0
    ${year}=    Set Variable    ${date_parts}[0]
#    ${year_btn}=    Get Year Btn    ${year}
    Sleep    0.5s
    ${month}=    Set Variable    ${date_parts}[1]
     ${day}=    Set Variable    ${date_parts}[2]  #${day} = 21 22:11:45
#    Click Element    ${year_btn}


